#pragma once
#ifndef __ENDPOINT_HPP__
#define __ENDPOINT_HPP__

#include <stdint.h>
#include <unordered_map>

struct alignas(32) Endpoint{
    uint32_t user;
    uint32_t host;
    uint32_t app;

    bool operator==(const Endpoint& p) const{
        return user == p.user && host == p.host && app == p.app;
    }
};


template<>
struct std::hash<Endpoint>{
    size_t operator()(Endpoint const& p)const noexcept{
        uint32_t tmp = (p.user << 16) ^ (p.host << 8) ^ p.app;
        return std::hash<uint32_t>()(tmp);
    }
};

#endif // __ENDPOINT_HPP__